<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/MainTemplate.Master" AutoEventWireup="true" CodeBehind="TitleDetailsPage.aspx.cs" Inherits="AlexandriaPressWebsite.MasterPages.UserPages.TitleDetailsPage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="mainDoc" runat="server">
    <h1>General Details</h1>
    <asp:GridView ID="DetailsGridView" runat="server" AutoGenerateColumns="False" 
        PageSize="1" CssClass="grid">
        <Columns>
            <asp:TemplateField HeaderText = "Book Details">
                <ItemTemplate>
                
                <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("BookCover") %>' CssClass="smallImage2" /><br />
                    TITLE: <asp:Label ID="BookTitle" runat="server" Text='<%# Eval("Title") %>'></asp:Label><br/>
                    AUTHOR: <asp:Label ID="BookAuthor" runat="server" Text='<%# Eval("Author") %>'></asp:Label><br />
                    DATE PUBLISHED: <asp:Label ID="DatePublished" runat="server" Text='<%# Eval("DatePublished") %>'></asp:Label><br />
                    GENRE: <asp:Label ID="BookGenre" runat="server" Text='<%# Eval("Genre") %>'></asp:Label><br />
                    QUANTITY IN STOCK: <asp:Label ID="BookQuantity" runat="server" Text='<%# Eval("QuantityInStock") %>'></asp:Label><br />
                    PRICE: <asp:Label ID="BookPrice" runat="server" Text='<%# Eval("Price") %>'></asp:Label><br />
                    <br />
                    <br />
                    <h1>Description</h1> 
                    <textarea id="TextArea1" runat="server" cols="20" rows="2" class="essay" readonly="readonly"><%# Eval("Description") %>  </textarea>                        
                </ItemTemplate>                   
            </asp:TemplateField>                      
        </Columns>
    </asp:GridView>
    <asp:Label ID="qtyLabel" runat="server" Text="Quantity: " 
        AssociatedControlID="numUnitsBox" CssClass="simplelabel"></asp:Label>
    <asp:TextBox ID="numUnitsBox" runat="server" ValidationGroup="AddToCart" CssClass="text"></asp:TextBox>
    <asp:Button ID="buyButton" runat="server" Text="Add to Cart" 
        onclick="buyButton_Click" CssClass="genericButton" 
        ValidationGroup="AddToCart" />
    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
        ControlToValidate="numUnitsBox" ErrorMessage="RegularExpressionValidator" 
        ValidationExpression="\d+" ValidationGroup="AddToCart" 
        CssClass="validator" Display="Dynamic">Only numbers for input please</asp:RegularExpressionValidator>
    <br />
    <asp:Label ID="notificationLabel" runat="server" CssClass="simplelabel"></asp:Label>                        
    <br/><br/><br/>
    <h1>Comments</h1>
    <asp:GridView ID="CommentsGridView" runat="server" AutoGenerateColumns="False" 
        BorderStyle="None" AlternatingRowStyle-CssClass="alterRow" 
        AllowPaging="True" OnPageIndexChanging="CommentsGridView_OnPageIndexChanging" CssClass="grid" PageSize="1" 
        UseAccessibleHeader="False">
        <RowStyle BorderStyle="None" />
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    Poster's Name: <asp:Label ID="reviewerName" runat="server" Text='<%# Eval("Commenter") %>' AssociatedControlID="commentArea"></asp:Label>
                    <textarea id="commentArea" runat="server" cols="20" rows="2" readonly="readonly" class="essay"><%# Eval("Comment") %></textarea>
                    Date Posted: <asp:Label ID="reviewerDate" runat="server" Text='<%# Eval("DatePosted") %>'></asp:Label>
                </ItemTemplate>                
            </asp:TemplateField>                    
        </Columns>
        <PagerStyle CssClass="pager" />
        <AlternatingRowStyle CssClass="alterRow" />
    </asp:GridView>        
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="formDoc" runat="server">
    <h1>
        <asp:Label ID="commentSeparatorLabel" runat="server" Text="Your Comments"></asp:Label></h1>
    <asp:Label ID="ratingLabel" runat="server" Text="Your Rating: " 
        AssociatedControlID="Rating" CssClass="label"></asp:Label>
    <asp:DropDownList ID="Rating" runat="server" CssClass="primaryList">
        <asp:ListItem Selected="True" Value="5">5 stars</asp:ListItem>
        <asp:ListItem Value="4">4 stars</asp:ListItem>
        <asp:ListItem Value="3">3 stars</asp:ListItem>
        <asp:ListItem Value="2">2 stars</asp:ListItem>
        <asp:ListItem Value="1">1 stars</asp:ListItem>
    </asp:DropDownList>
    <asp:Label ID="commentsLabel" runat="server" Text="Your Comments: " 
        AssociatedControlID="commentArea" CssClass="label"></asp:Label>
    <textarea id="commentArea" runat="server" cols="20" rows="2" name="commentArea" 
        class="textreg"></textarea>
        <br/>

    <asp:Button ID="commentButton" runat="server" Text="Submit" 
        onclick="commentButton_Click" CssClass="formButton" 
        ValidationGroup="Comment" />
    <asp:Label ID="MessageLabel" runat="server" 
        Text="An error with passing your input occurred. Please try again later.&lt;br/&gt;&lt;br/&gt;" 
        Visible="False" CssClass="label"></asp:Label>               
</asp:Content>

